package cn.itcast.bos.Dao.base;

import cn.itcast.bos.domain.base.Area;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;


/**
 * Created by Administrator on 2017/7/21.
 */
public interface AreaDao extends JpaRepository<Area ,String>,JpaSpecificationExecutor<Area> {
    @Query ("update Area set status='1' where id=?")
    @Modifying
    void del(String id);
    Page<Area> findAllByStatusIsNull(Specification specification, Pageable pageable);
    //通过省市区查询对应得区域
    Area findByProvinceAndCityAndDistrict(String province,String city ,String district);
}
